Anisotropic diffusion filtering (ADF) is widely used as an efficient method in random noise attenuation problems, and various modifications to its original version have been proposed. The main reason could be the thought that ADF preserves edge features with acceptable performance beside noise attenuation procedure. In seismic data processing, however, it should be noticed that using ADF could cause severe changes (artifacts) in the zones that are highly contaminated with random noise. In this paper, the optimum value is derived, by introducing an automatic framework based on two artificial intelligence (AI) algorithms, adaptive neuro-fuzzy inferences (ANFIS) and fuzzy c-mean clustering (FCM). The neuro-fuzzy network is trained using original data, successive ADF values are calculated for each data point, and FCM output is obtained in a weighted averaging manner adapted with estimated noise level. The trained network is, then, generalized to all data, and thus, the ANFIS optimized version of ADF, called here AOADF, is achieved. Comparison of the results of the ADF and AOADF experiments reveals that in synthetic common mid-point (CMP) gathers, the proposed method improves peak signal to noise ratio (PSNR) value, 40% higher than ADF (in the best case) and in real CMP and common offset sorted gathers, the performance of AOADF is considerably higher than ADF, in terms of random noise attenuation without adding unwanted artifacts and preserving continuity of coherence components.